import pers.lc.testDataGenerator.data.ColumnData;
import pers.lc.testDataGenerator.rule.ColumnRangeRule;
import pers.lc.testDataGenerator.service.ScreenService;
import pers.lc.testDataGenerator.service.TestService;

import java.time.Duration;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;

public class Main {
    public static void main(String[] args) {
        System.out.println(System.currentTimeMillis());
        String in = "";
        String out ="";
        String a = "";
        System.out.println(out);
        LocalDateTime fromDateTime = LocalDateTime.parse("2012-08-20 12:00:00", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
        LocalDateTime toDateTime = LocalDateTime.parse("2012-08-20 11:59:20", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
        Duration interval = Duration.between(fromDateTime,toDateTime);
        System.out.println(interval.toDays()+"     "+interval.toMillis()+"       "+interval.getSeconds());
        new Main().test();
        List<ColumnData> columnDataList = new ArrayList<>();
        columnDataList.add(new ColumnData("testInt","long","100","200",new ColumnRangeRule("single_rule_1","")));
        columnDataList.add(new ColumnData("testDateTime","date_time","yyyy-MM-dd HH:mm:ss","2012-08-20 12:00:00","2012-10-20 12:00:00",new ColumnRangeRule("single_rule_1","")));
        new TestService().generateOne(columnDataList).forEach(s->System.out.println(s.toString()));
        List<ColumnData> columnDataList1 = new ArrayList<>();
        columnDataList1.add(new ColumnData("testInt","long","100","200",new ColumnRangeRule("multi_rule_2","10")));
        columnDataList1.add(new ColumnData("testDateTime","date_time","yyyy-MM-dd HH:mm:ss","2012-08-20 12:00:00","2012-10-20 12:00:00",new ColumnRangeRule("multi_rule_1","")));
        new TestService().generateMulti(columnDataList1,10).forEach(s->System.out.println(s.toString()));
    }
    public void test(){
        System.out.println(ColumnRangeRule.singleRule1("2012-08-20 12:00:00","2012-10-20 12:00:00","date_time","yyyy-MM-dd HH:mm:ss"));
    }
}